<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>OpenLayers v8.2.0 API - Class: CollectionEvent</title>
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"
        crossorigin="anonymous"></script>
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/fontawesome.min.css"
        crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/solid.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/brands.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="styles/prettify-tomorrow.css">
    <link rel="stylesheet" type="text/css" href="styles/jaguar.css">
    <link rel="stylesheet" type="text/css" href="styles/carbon.css">
    <link rel="stylesheet" type="text/css" href="/theme/ol.css">
    <link rel="stylesheet" type="text/css" href="/theme/site.css">
</head>

<body>
    <header class="navbar navbar-expand-sm navbar-dark mb-3 px-3 py-0 fixed-top" role="navigation">
        <a class="navbar-brand" href="/"><img src="/theme/img/logo-dark.svg" width="70" height="70"
                alt="">&nbsp;OpenLayers</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#olmenu"
            aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <!-- menu items that get hidden below 768px width -->
        <nav class="collapse navbar-collapse" id="olmenu">
            <ul class="nav navbar-nav ms-auto">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="docdropdown" role="button"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Docs</a>
                    <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="docdropdown">
                        <a class="dropdown-item" href="/doc/">Docs</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="/doc/quickstart.html"><i
                                class="fa fa-check fa-fw me-2 fa-lg"></i>快速入门</a>
                        <a class="dropdown-item" href="/doc/faq.html"><i
                                class="fa fa-question fa-fw me-2 fa-lg"></i>FAQ</a>
                        <a class="dropdown-item" href="/doc/tutorials/"><i
                                class="fa fa-book fa-fw me-2 fa-lg"></i>Tutorials</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="https://stackoverflow.com/questions/tagged/openlayers"><i
                                class="fab fa-stack-overflow fa-fw me-2"></i>Ask a Question</a>
                    </div>
                </li>
                <li class="nav-item"><a class="nav-link" href="/en/latest/examples/">Examples</a></li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="apidropdown" role="button"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="fa fa-sitemap me-1"></i>API
                    </a>
                    <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="apidropdown">
                        <a class="dropdown-item" href="/en/latest/apidoc/"><i
                                class="fa fa-sitemap fa-fw me-2 fa-lg"></i>v8.2.0
                            (latest)</a </div>
                </li>
            </ul>
        </nav>
    </header>

    <div class="container-fluid">
        <div id="wrap" class="row">
            <div class="navigation col-md-4 col-lg-3">
                <div class="search-wrapper">
                    <div class="search">
                        <input id="search" type="text" autocomplete="off" class="form-control input-sm"
                            placeholder="Search Documentation">
                    </div>
                </div>
                <div class="navigation-list-wrapper">
                    <ul class="navigation-list search-empty">
                        <li class="item item-class toggle-manual toggle-manual-show"
                            data-longname="module:ol/Collection.CollectionEvent"
                            data-name="ol/collection.collectionevent">
                            <span class="title toggle">
                                <span class="fa fa-chevron-right me-2 mt-1"></span>
                                <span><a
                                        href="module-ol_Collection.CollectionEvent.html">ol​/Collection​.CollectionEvent</a></span>
                            </span>
                            <div class="member-list" data-type="members">
                                <span class="subtitle">Members</span>
                                <ul>
                                    <li data-name="element"><a
                                            href="module-ol_Collection.CollectionEvent.html#element">element</a>
                                    <li data-name="index"><a
                                            href="module-ol_Collection.CollectionEvent.html#index">index</a>
                                    <li data-name="target"><a
                                            href="module-ol_Collection.CollectionEvent.html#target">target</a>
                                    <li data-name="type"><a
                                            href="module-ol_Collection.CollectionEvent.html#type">type</a>
                                </ul>
                            </div>
                            <div class="member-list" data-type="methods">
                                <span class="subtitle">Methods</span>
                                <ul>
                                    <li data-name="preventdefault"><a
                                            href="module-ol_Collection.CollectionEvent.html#preventDefault">preventDefault</a>
                                    <li data-name="stoppropagation"><a
                                            href="module-ol_Collection.CollectionEvent.html#stopPropagation">stopPropagation</a>
                                </ul>
                            </div>
                        <li class="loading">Loading …
                    </ul>
                </div>
            </div>

            <div class="main col-md-8 col-lg-9">
                <h1 class="page-title" data-filename="module-ol_Collection.CollectionEvent.html">Class: CollectionEvent
                </h1>
                <div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
                    <button id="latest-dismiss" type="button" class="btn-close" data-bs-dismiss="alert"
                        aria-label="Close"></button>
                    This documentation is for OpenLayers v<span id="package-version">8.2.0</span>. The <a
                        id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
                </div>




                <section class="content">

                    <header>
                        <h2 class="my-3">
                            <span class="ancestors"><a
                                    href="module-ol_Collection.html">ol/Collection</a>.</span>CollectionEvent
                        </h2>
                        <br>

                        <div class="row p-3 ">
                            <!-- <div id="ad" class="col-lg-5 order-2 align-self-center border rounded bg-light ">
                                <script async type="text/javascript"
                                    src="https://cdn.carbonads.com/carbon.js?serve=CE7DV53U&placement=openlayersorg"
                                    id="_carbonads_js"></script>
                            </div> -->

                            <div class="class-description col-lg-7 align-self-center ps-0">
                                <p>由<a
                                        href="module-ol_Collection-Collection.html"><code>Collection</code></a>实例发出的事件是此类型的实例。
                                </p>
                            </div>

                        </div>
                    </header>

                    <article>
                        <div class="container-overview">



                            <dl>

                                <dt class="">


                                </dt>
                                <dd class="">












                                    <dl class="details">





















                                    </dl>













                                </dd>

                            </dl>

                        </div>




                        <h3 class="subsection-title">Extends</h3>

                        <ul>
                            <li><a href="module-ol_events_Event-BaseEvent.html">BaseEvent</a></li>
                        </ul>













                        <h3 class="subsection-title">Members</h3>

                        <dl>

                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="element">
                                    </div>
                                    <h4 class="name">
                                        element<span class="type-signature type t">{T}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>添加到或从集合中移除的元素。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="index">
                                    </div>
                                    <h4 class="name">
                                        index<span class="type-signature type number">{number}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>添加或移除元素的索引。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="target">
                                    </div>
                                    <h4 class="name">
                                        target<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>事件目标。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="type">
                                    </div>
                                    <h4 class="name">
                                        type<span class="type-signature type string">{string}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>事件类型。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>

                        </dl>



                        <h3 class="subsection-title">Methods</h3>

                        <dl>


                            <dt class="">

                                <div class="nameContainer inherited">
                                    <div class="anchor" id="preventDefault">
                                    </div>
                                    <h4 class="name">
                                        preventDefault<span class="signature">()</span>

                                        <span class="inherited"><a
                                                href="module-ol_events_Event-BaseEvent.html#preventDefault">inherited</a></span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/Event.js">events/Event.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/Event.js#L50">line
                                            50</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">




                                <div class="description">
                                    <p>阻止默认行为。这意味着不会触发 <code>click</code>,
                                        <code>singleclick</code> or <code>doubleclick</code>
                                        事件。
                                    </p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>




                            <dt class="">

                                <div class="nameContainer inherited">
                                    <div class="anchor" id="stopPropagation">
                                    </div>
                                    <h4 class="name">
                                        stopPropagation<span class="signature">()</span>

                                        <span class="inherited"><a
                                                href="module-ol_events_Event-BaseEvent.html#stopPropagation">inherited</a></span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/Event.js">events/Event.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/Event.js#L58">line
                                            58</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">
                                <div class="description">
                                    <p>停止事件传播。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>

                        </dl>





                        <h3 class="subsection-title">Events</h3>

                        <dl>

                            <dt class="">

                                <div class="nameContainer">
                                    <div class="anchor" id="event:add">
                                    </div>
                                    <h4 class="name">
                                        add



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/CollectionEventType.js">CollectionEventType.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/CollectionEventType.js#L9">line
                                            9</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">




                                <div class="description">
                                    <p>当项目被添加到集合中时触发。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>



                            <dt class="">

                                <div class="nameContainer inherited">
                                    <div class="anchor" id="event:change">
                                    </div>
                                    <h4 class="name">
                                        change

                                        <span class="inherited"><a
                                                href="module-ol_events_Event-BaseEvent.html#event:change">inherited</a></span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/EventType.js">events/EventType.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/EventType.js#L10">line
                                            10</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">
                                <div class="description">
                                    <p>通用更改事件。当修订计数器增加时触发。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>



                            <dt class="">

                                <div class="nameContainer inherited">
                                    <div class="anchor" id="event:error">
                                    </div>
                                    <h4 class="name">
                                        error

                                        <span class="inherited"><a
                                                href="module-ol_events_Event-BaseEvent.html#event:error">inherited</a></span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/EventType.js">events/EventType.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/events/EventType.js#L17">line
                                            17</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">
                                <div class="description">
                                    <p>通用错误事件。当发生错误时触发。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>



                            <dt class="">

                                <div class="nameContainer">
                                    <div class="anchor" id="event:remove">
                                    </div>
                                    <h4 class="name">
                                        remove



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/CollectionEventType.js">CollectionEventType.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/CollectionEventType.js#L15">line
                                            15</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">




                                <div class="description">
                                    <p>当项目从集合中移除时触发。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>

                        </dl>

                    </article>

                </section>




            </div>
        </div>
    </div>
    <script>prettyPrint();</script>
    <script src="scripts/linenumber.js"></script>
    <script src="scripts/main.js"></script>
</body>

</html>